/**
 * 
 */
package com.Hib.Util;

import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;

/**
 * @author Ignatiues charles arun
 * 
 */
public class SessionManager
	{

		private static final SessionFactory sessionFactory = buildSessionFactory();

		/**
		 * @return the sessionfactory
		 */
		public static SessionFactory getSessionfactory()
			{
				return sessionFactory;
			}

		private static SessionFactory buildSessionFactory()
			{
				try
					{
						// Create a SessionFactory from HibRecepies.cfg.xml
						return new Configuration().configure(
								"com/Hib/Cfg/HibRecepies.cfg.xml")
								.buildSessionFactory();
					} catch (Exception ex)
					{
						ex.printStackTrace();
					}
				return null;
			}
	}
